home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
1997.ZIP
/
WINDO28.ARC
/
WINTUTOR.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1988-09-30
|
10KB
|
265 lines
{$B+} {Boolean complete evaluation on}
program WinTutor(input,output);
Uses
Crt, Windo28;
var i: integer;
a: string[127];
j,k: byte;
const
stra : array [1..13] of winstr = (
'',
'The windowing procedures in the file',
'WINDO28.TPU are a set of shareware',
'routines that allow Turbo PASCAL to create',
'and use windows. The windows may be of any',
'size (from 2 X 2 to 80 X 25) and color, and',
'may have one of several different border',
'styles, including no border. Once inside a',
'window, the normal Turbo PASCAL procedures',
'"textcolor" and "textbackground" may be used',
'to change character attributes. The window',
'routines automatically determine whether you',
'are using a color or monochrome display.');
strb : array [1..14] of winstr = (
'',
'The window procedures package consists of four procedures;',
'"Initwindo", "Makewindo", "Removewindo" and "Titlewindo".',
'The procedures are described in the following windows:',
'INITWINDO',
'',
'FORMAT: INITWINDO (textcolor,textbackground : integer);',
'',
'Initwindo initializes several variables required by the',
'windowing package, as well as selecting the foreground and',
'background colors of the initial screen display. Initwindo',
'must be called before using either of the other procedures.',
'After using Initwindo, normal action is to clear the screen',
'with ClrScr.');
strc : array [1..16] of winstr = (
'MAKEWINDO',
'',
'FORMAT: MAKEWINDO (X1,Y1,X2,Y2,txtcolor,txtbkgnd,border,shadow : integer);',
'',
'Makewindo puts a new blank window on the display. The window starts at the',
'upper left corner (X1,Y1) and ends at the lower right corner (X2,Y2). If',
'a border exists, the actual dimensions of the window will be 2 less than',
'indicated in the Makewindo statement. The border can be one of the follow-',
'ing:',
'',
' singleb - single border doubleb - double border',
' solidb - solid border noneb - no border',
' mixedb - single sides, double top border',
' dimondb - diamond border circleb - circles border',
' lhatchb - light hatch border mhatchb - medium hatch border',
' dhatchb - dense hatch border');
strca : array [1..7] of winstr = (
'Makewindo can also put a shadow on the screen when',
'creating a window. This is the purpose of the shadow',
'variable. It may have the following values:',
'',
' lefts - put a shadow on the left side of a window',
' rights- put a shadow on the right side of a window',
' nones - don''t put any shadow up.');
strd : array [1..6] of winstr = (
'REMOVEWINDO',
'FORMAT: REMOVEWINDO;',
'',
'Removewindo removes the last window',
'that was placed on the screen by the',
'Makewindo procedure.');
stre : array [1..8] of winstr = (
'TITLEWINDO',
'FORMAT: TITLEWINDO (title: string[80]; placed,attributes: byte);',
'',
'Titlewindo places a title wherever you specify by the ''placed''',
'variable, using the given attributes. ''Placed'' may be one of:',
' leftt - Left top rightt - Right top centert - Center top',
' leftb - Left bottom rightb - Right bottom centerb - Center bottom',
'Using titlewindo is strictly optional.');
strf : array [1..6] of winstr = (
'',
' The maximum number of windows that',
' may be on the screen at any one time',
' is specified by the variable',
' "maxwin". Maxwin is currently 30',
' and is limited to a maximum of 255.');
stri : array [1..14] of winstr = (
'',
' There are five utility procedures that may be',
' of use:',
'',
' Bleep(number_of_bleeps : byte);',
' ErrorSound;',
' Set_cursor(Cursor_Size : byte);',
' DispLine(colb,rowb,attrib : byte, str : winstr);',
' Wattr(text,backgnd: byte) : byte;',
'',
' colb and rowb is relative to the entire screen.',
' attrib := Wattr(textcolor,backgroundcolor);',
' str is a string of length 80.',
' backgroundcolor should be less than 8.');
strg : array [1..19] of winstr = (
' The procedures are used as follows:',
'',
' {$M 16384,0,131072}',
' Program xxx(Input,Output);',
' Uses Windo27;',
' ...your variables and procedures...',
' Begin',
' .',
' Initwindo(textcolor,textbackground);',
' ClrScr;',
' .',
' Makewindo(begcol,begrow,endcol,endrow,txtcol,txtbkgnd,brdr,shadow);',
' Titlewindo(''This is the window title'',placed,attributes);',
' .',
' Removewindo;',
' .',
' End.',
'',
' Use one removewindo for each makewindo.');
strh : array [1..7] of winstr = (
'If you have any questions or comments,',
'please write to or call:',
'',
' Michael Burton',
' 15540 Boot Hill Rd.',
' Hayden Lake, ID 83835',
' (208)772-9347 (after 1800 PST)');
begin
set_cursor(0); { Turn off the cursor }
initwindo(blue,cyan); { Initialize the window routines }
clrscr;
For i := 1 to 30 do { Put up 30 random windows }
begin
j := random(69);
k := random(20);
makewindo(j+1,k+1,j+11,k+5,yellow,red,lhatchb,rights);
gotoxy(2,2);
Write('WINDOWS');
end;
delay(3000);
for i := 1 to 30 do removewindo; { Erase the 30 random windows }
gotoxy(25,1);
writeln('Turbo PASCAL Windows Tutorial');
textcolor(black);
gotoxy(14,12);
writeln('This is the original screen. It is not a window.');
Delay(2000);
{ Put the opening blurb in the first window. }
makewindo(3,3,49,18,black,green,mixedb,nones);
titlewindo(' Turbo PASCAL Windows ',centert,Wattr(black,green));
titlewindo(' Enter to Continue ',centerb,Wattr(yellow,green));
For j :=1 to 13 do DispLine(3,j+2,Wattr(black,green),stra[j]);
readln;
{ Put the initwindo explanation in the second window }
makewindo(1,5,61,23,yellow,red,singleb,nones);
titlewindo(' Turbo PASCAL Windows (Continued) ',centert,Wattr(yellow,red));
titlewindo(' Enter to Continue ',centerb,Wattr(white,red));
For j :=1 to 4 do DispLine(1,j+4,Wattr(yellow,red),strb[j]);
DispLine(4,10,Wattr(white,blue),strb[5]);
For j :=6 to 8 do DispLine(1,j+5,Wattr(cyan,red),strb[j]);
For j :=9 to 14 do DispLine(1,j+5,Wattr(white,red),strb[j]);
readln;
{ Put the makewindo explanation in the third window }
makewindo(2,4,80,24,lightmagenta,blue,solidb,nones);
titlewindo(' Turbo PASCAL Windows (Continued) ',centert,Wattr(lightmagenta,blue));
titlewindo(' Enter to Continue ',centerb,Wattr(white,blue));
DispLine(7,5,Wattr(yellow,red),strc[1]);
For j :=2 to 4 do DispLine(3,j+5,Wattr(lightred,blue),strc[j]);
For j :=5 to 16 do DispLine(3,j+5,Wattr(yellow,blue),strc[j]);
readln;
{ More of the makewindo explanation in the fourth window }
makewindo(12,6,68,16,black,lightgray,mixedb,rights);
titlewindo(' Turbo PASCAL Windows (Continued) ',centert,Wattr(black,lightgray));
titlewindo(' Enter to Continue ',centerb,Wattr(yellow,lightgray));
For j :=1 to 7 do DispLine(13,j+6,Wattr(black,lightgray),strca[j]);
readln;
{ Put the removewindo explanation in the fifth window }
makewindo(13,10,51,21,black,brown,doubleb,nones);
titlewindo(' Turbo PASCAL Windows (Continued) ',centert,Wattr(black,brown));
titlewindo(' Enter to Continue ',centerb,Wattr(yellow,brown));
DispLine(17,11,Wattr(white,magenta),strd[1]);
DispLine(13,13,Wattr(yellow,brown),strd[2]);
For j :=3 to 6 do DispLine(13,j+11,Wattr(white,brown),strd[j]);
readln;
{ Put the titlewindo explanation in the sixth window }
makewindo(3,10,75,23,red,lightgray,dimondb,nones);
titlewindo(' Turbo PASCAL Windows (Continued) ',centert,Wattr(lightgray,red));
titlewindo(' Enter to Continue ',centerb,Wattr(yellow,red));
DispLine(8,12,Wattr(lightgreen,blue),stre[1]);
DispLine(4,14,Wattr(black,lightgray),stre[2]);
For j :=3 to 8 do DispLine(4,j+12,Wattr(red,lightgray),stre[j]);
readln;
{ Put maxwin explanation in the seventh window }
makewindo(12,16,49,22,black,brown,noneb,lefts);
Titlewindo(' Enter to Continue ',centerb,Wattr(yellow,brown));
For j :=1 to 6 do DispLine(11,j+14,Wattr(black,brown),strf[j]);
readln;
{ Put the utilities explanation in the eighth window }
makewindo(20,7,70,23,yellow,red,circleb,nones);
titlewindo(' Utility Procedures ',centert,Wattr(yellow,red));
titlewindo(' Enter to Continue ',centerb,Wattr(yellow,red));
For j :=1 to 14 do DispLine(20,j+6,Wattr(white,red),stri[j]);
readln;
{ Put the using the routines explanation in the ninth window }
makewindo(3,2,78,24,black,magenta,mhatchb,nones);
titlewindo(' Using The Routines ',centert,Wattr(yellow,magenta));
titlewindo(' Enter to Continue ',centerb,Wattr(white,magenta));
For j :=1 to 19 do DispLine(4,j+3,Wattr(black,magenta),strg[j]);
readln;
{ Put the advertising in the tenth window }
makewindo(20,8,60,17,black,brown,dhatchb,nones);
titlewindo(' Enter to Exit ',centerb,Wattr(yellow,brown));
For j :=1 to 7 do DispLine(21,j+8,Wattr(white,brown),strh[j]);
readln;
removewindo; { Now get rid of all the windows }
removewindo;
removewindo;
removewindo;
removewindo;
removewindo;
removewindo;
removewindo;
removewindo;
removewindo;
gotoxy(1,2);
clreol;
gotoxy(1,12);
clreol;
gotoxy(21,12);
writeln('This concludes the windows tutorial...');
delay(2000);
set_cursor(2);
textcolor(white);
textbackground(black);
clrscr;
end.